<template>
	<view class="dialog">
		<view class="mask"></view>
		<view class="layer">
			<view class="inner">
				<view class="close" @click="hanvieweClose">
					<image src="https://wx.2024csnl.com/static/lottery/lottery-close.png" mode="widthFix" alt="">
				</view>
				<view class="top"></view>
				<view class="dian">
					<image src="https://wx.2024csnl.com/static/lottery/lottery-22.png" alt="">
				</view>
				<view class="box">
					<view class="context">
						<view class="table">
							<view class="title">
								<text>{{title}}</text>
							</view>
							<view class="thead">
								<view v-if="false" class="item  t1">
									<text>序号</text>
								</view>
								<view v-if="false" class="item t2">
									<text>奖励</text>
								</view>
								<view v-if="false" class="item t3">
									<text>时间</text>
								</view>
							</view>
							<view class="tbody">
								<view v-for="(item, index) in prizeList" :key="index" class="rows">
									<view v-if="false" class="item t1">
										<view class="user" style="text-align: center;">
											<text style="text-align: center;">{{ index + 1 }}</text>
										</view>
									</view>
									<view class="item t2">
										<view class="gift">
											<text>{{ item.text }}</text>
										</view>
									</view>
									<view v-if="false" class="item t3">
										<view class="time">
											<text>{{ item.time }}</text>
										</view>
									</view>
								</view>
								<view v-if="prizeList.length <= 0" class="rows"
									style="text-align: center;padding: 20px;">
									<text style="text-align: center;">暂无数据</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tableData: []
			}
		},
		props: {
			title: {
				type: String,
				default: "中奖名单"
			},
			prizeList: {
				type: Array,
				default: []
			}
		},
		methods: {
			hanvieweClose() {
				this.$emit('callback', {})
			}
		}
	}
</script>

<style lang="less" scoped>
	.dialog {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999;

		.mask {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			z-index: 0;
			background: rgba(0, 0, 0, .8);
		}

		.layer {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			z-index: 1;
			display: flex;
			justify-content: space-evenly;
			flex-direction: column;
		}

		.inner {
			position: relative;
			animation: zoomIn .3s ease;
		}

		.close {
			position: absolute;
			right: 0;
			top: -50px;
			z-index: 10;
			padding: 20px;

			image {
				display: block;
				width: 30px;
				height: 30px;
			}
		}

		.top {
			position: relative;
			z-index: 1;
			margin: 0 3vw;
			height: 50px;

			&::before {
				content: '';
				display: block;
				width: 100%;
				height: 100px;
				border-radius: 50%;
				background: #f45e1a;
			}
		}

		.dian {
			position: absolute;
			left: 0;
			right: 0;
			top: -40px;
			z-index: 2;

			image {
				display: block;
				width: 100%;
			}
		}

		.box {
			position: relative;
			z-index: 3;
			padding: 0 10px 10px;
			border-radius: 0 0 20px 20px;
			margin: 0 3vw;
			background: -webkit-linear-gradient(top, #f45e1a, #f4a24b);

			&::before {
				content: '';
				position: absolute;
				left: 0;
			}
		}

		.context {
			position: relative;
			border-radius: 10px;
			background: -webkit-linear-gradient(top, #ffffff, #f7d097);
			box-shadow: 0 2px 10px fade(#f45e1a, 100%);
		}
	}

	.table {
		padding: 5px;

		.title {
			position: relative;
			text-align: center;
			line-height: 50px;
			font-size: 18px;
			color: #e91111;

			&::before,
			&::after {
				content: '●';
				font-size: 14px;
			}

			text {
				margin: 0 8px;
			}
		}

		.thead {
			display: flex;

			.item {
				flex: 1;
				text-align: center;
				height: 40px;
				line-height: 40px;
				color: #999999;

				&.t1 {
					flex: none;
					width: 100px;
				}

				&.t3 {
					flex: none;
					width: 130px;
				}
			}
		}

		.tbody {
			max-height: 50vh;
			overflow: hidden;
			overflow-y: auto;

			.rows {
				display: flex;
				background: fade(#ffffff, 70%);
				margin: 0 0 5px;
				padding: 0px;
				border-radius: 8px;

				.item {
					flex: 1;
					line-height: 40px;

					&.t1 {
						flex: none;
						width: 100px;
					}

					&.t2 {
						color: #ff2785;
						font-weight: bold;
						font-size: 12px;
						text-align: center;
					}

					&.t3 {
						flex: none;
						width: 130px;
						text-align: center;
						color: #333333;
						font-family: DinProMedium;
					}
				}
			}

			.user {
				max-width: 100px;
				height: 40px;
				line-height: 40px;
				color: #333333;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;

				image {
					vertical-align: middle;
					width: 24px;
					height: 24px;
					border-radius: 50%;
					margin: 0 8px 0 0;
				}

				text {
					vertical-align: middle;
					line-height: 24px;
				}
			}
		}
	}
</style>